package com.app.controller;

import com.app.common.DataType;
import com.app.util.DBManager;

public class DBHelper {

	public static void update(DataType weatherInfo) {
		DBManager db = new DBManager();
		switch (weatherInfo) {
		case ALL_INFO:
			db.updateAll();
			break;
		case BUS_INFO:
			db.updateBusInfo();
			break;
		case SHARE_INFO:
			db.updateShareInfo();
			break;
		case VEGETABLES_IFNO:
			db.updateVegInfo();
			break;
		case WEATHER_INFO:
			db.updateWeatherInfo();
			break;
		default:
			break;
		}
	}

	public static void init(DataType weatherInfo) {
		DBManager db = new DBManager();
		switch (weatherInfo) {
		case ALL_INFO:
			db.initAll();
			break;
		case BUS_INFO:
			db.initBusInfo();
			break;
		case SHARE_INFO:
			db.initShareInfo();
			break;
		case VEGETABLES_IFNO:
			db.initVegInfo();
			break;
		case WEATHER_INFO:
			db.initWeatherInfo();
			break;
		default:
			break;
		}
	}
}
